#include "normalinfor.h"

NormalInfor* NormalInfor::_instance=nullptr;

NormalInfor* NormalInfor::GetInstance(QObject* parent){
    if(NormalInfor::_instance==nullptr)
        NormalInfor::_instance=new NormalInfor(parent);
    return NormalInfor::_instance;
}

NormalInfor::~NormalInfor(){

}

void NormalInfor::SubmitInfor(Yzty::ITEMCODE mcode,QVector<Yzty::BaceInfor*>& infors){
    std::lock_guard<std::mutex> glock(this->_mutex);
    this->_infors[mcode]=std::move(infors);
}

const QVector<Yzty::BaceInfor*>& NormalInfor::GetItemInfor(Yzty::ITEMCODE icode){
    std::lock_guard<std::mutex> glock(this->_mutex);
    return this->_infors[icode];
}

NormalInfor::NormalInfor(QObject* parent):QObject (parent),_infors(int(Yzty::NormalToolCode::NUMS)){

}
